<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">{:__('基本信息')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('ID:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.id}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('订单编号:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.number}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('订单类型:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row->typeText}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('兑换时间:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.created_at|datetime}</p>
                </div>
            </div>
            {if condition="$row.type == 'activity'"}
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('成员分组:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row->memberData ? $row->memberData->groupText : '已删除'}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('姓名:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row->memberData->name ?? '已删除'}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('编号:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row->memberData->number ?? '已删除'}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('手机号:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row->memberData->phone ?? '已删除'}</p>
                </div>
            </div>
            {/if}
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('礼品名称:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$giftData['name']}</p>
                </div>
                {notempty name="$giftData['spec_data']"}
                <label class="col-sm-1 control-label">{:__('礼品规格:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$giftData['spec_data']['name']}</p>
                </div>
                {/notempty}
                {notempty name="$giftData['order_amount']"}
                <label class="col-sm-1 control-label">{:__('礼品礼币:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$giftData['order_amount']}</p>
                </div>
                {/notempty}
                <label class="col-sm-1 control-label">{:__('礼品价格:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$giftData['order_worth']}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('领取方式:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.gain_method_text}</p>
                </div>
                {notempty name="$giftData['code_data']"}
                <label class="col-sm-1 control-label">{:__('券码信息:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$codeMix}</p>
                </div>
                {/notempty}
                <label class="col-sm-1 control-label">{:__('发货时间:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{php}echo $row['deployed_at'] ? date('Y-m-d H:i:s', $row['deployed_at']) : '';{/php}</p>
                </div>
            </div>
            <div class="form-group">
                {if condition="$row.type == 'activity'"}
                <label class="col-sm-1 control-label">{:__('礼品活动:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.activityData ? $row.activityData.name : '已删除'}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('花费礼币:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.amount}</p>
                </div>
                {/if}
                {if condition="$row.type == 'card'"}
                <label class="col-sm-1 control-label">{:__('礼卡:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.cardData ? $row.cardData.name : '已删除'}</p>
                </div>
                {/if}
                <label class="col-sm-1 control-label">{:__('处理状态:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.status_text}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('更新时间:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.updated_at|datetime}</p>
                </div>
            </div>
        </form>
    </div>
</div>

{if condition="$row.gain_method == '2'"}
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">{:__('收货信息')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('收件人:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.name}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('手机号:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.phone}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('收货地址:')}</label>
                <div class="col-sm-5">
                    <p class="form-control-static">{$row.province} {$row.city} {$row.area} {$row.address}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('备注:')}</label>
                <div class="col-sm-11">
                    <p class="form-control-static">{$row.note}</p>
                </div>
            </div>
        </form>
    </div>
</div>
{/if}

{if condition="$row.gain_method == 2 and $row.status == 2"}
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">{:__('快递信息')}</h3>
    </div>
    <div class="panel-body">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('快递公司:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.express_company_text}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('快递单号:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.express_number}</p>
                </div>
                <label class="col-sm-1 control-label">{:__('快递手机号:')}</label>
                <div class="col-sm-2">
                    <p class="form-control-static">{$row.express_phone}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">{:__('物流状态:')}</label>
                <div class="col-sm-11">
                    <div class="form-control-static">
                        <span class="label label-primary track-state">{$trackInfo['state_text']}</span>
                        {if condition="$trackInfo['track_list']"}
                        <div class="track-list">
                            {volist name="trackInfo['track_list']" id="item"}
                            <p><?= $item['time'] ?>&nbsp;&nbsp;&nbsp;&nbsp;<?= $item['context'] ?></p>
                            {/volist}
                        </div>
                        {/if}
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
{/if}

<style>
    .track-list {
        margin-top: 10px;
    }
</style>
